perf(ds4): elide intermediate prefill logits and tune gfx1151 mmq tiles - #633
Open
cheese-cakee wants to merge 4 commits into
Open
perf(ds4): elide intermediate prefill logits and tune gfx1151 mmq tiles#633cheese-cakee wants to merge 4 commits into
cheese-cakee wants to merge 4 commits into
Conversation
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 4 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
…d preserve cuda mmq fallback
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improves DeepSeek4 prompt processing by removing unnecessary intermediate logits work and tuning the Strix Halo MMQ path.
The patch delivers matched current-main gains at chunk 512 on both supported Lucebox placements:
It keeps terminal logits and stateful execution on their existing correctness paths, while limiting MMQ tile changes to RDNA3.5/gfx1151.
Why this is useful
Intermediate prefill steps do not consume vocabulary logits. Before this change, those steps could still execute the full 150k x 4096 LM-head projection, output RMSNorm, and synchronous device-to-host logits readback.
This PR allows those intermediate steps to stay on a no-logits graph while preserving logits generation wherever the server actually needs it. The result is less unnecessary compute and synchronization during prompt processing, with measurable gains on both dual-GPU and Strix-only hardware.
Changes
48x64with four warps.Matched performance
Evidence label: maintainer-measured. The maintainer reran PR #633 on Lucebox4 against current
mainwith the same ROCmFP2 model, hardware placement, environment, and chunk size on both sides of every A/B comparison.Candidate head:
a2878db6ec0d03a6252a6f8222169425e8c62298.mainThe matched chunk-512 results show that the optimization benefits both the heterogeneous Lucebox path and the standalone Strix Halo path.
At chunk 2048, absolute throughput remains higher than at chunk 512, but this PR is 2.3% slower than its matched current-main baseline. That wide-chunk interaction is a focused follow-up tuning opportunity
Correctness and compatibility
The optimization changes when intermediate logits are materialized; it does not intentionally change attention, HC residual streams, MoE routing, KV-cache updates, compressor pooling, or terminal sampling behavior.
The final logits-needed step remains explicit, and snapshot and speculative-drafter feature paths continue to request the outputs they consume.
Known limitation
main. The chunk-512 paths improve on both tested hardware placements.Verification
test_deepseek4_uniton Lucebox dual GPU, gfx1201 + gfx1151, ROCm 7.2.4: 53/53 passed.test_deepseek4_uniton CUDA SM 8.9: 53/53 passed.git diff --check: clean.